base_dir=$(
  cd "$(dirname "$0")"
  pwd
)
echo $base_dir

wget https://dl.influxdata.com/telegraf/releases/telegraf-1.26.0_linux_amd64.tar.gz
mv *telegraf*.tar.gz telegraf.tar.gz
tar -xf telegraf.tar.gz
mv *telegraf-* telegraf
cp telegraf.conf $base_dir/telegraf/etc/telegraf/telegraf.conf
export TELEGRAF_CONFIG_PATH=$base_dir/telegraf/etc/telegraf/telegraf.conf
export INFLUX_TOKEN=qsOyan6s9gS2JYWCuWncwTcygUEdZiY7yN5vKiCJvW4qOUzgC4D6WHdUegzbR5oQw0Hd3V8Y6y5iZeynoktyUQ==
# ./Telegraf --config http://192.168.20.9:8086/api/v2/telegrafs/0b3379e311a8a000
cd $base_dir/telegraf/usr/bin/
./telegraf
